import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_common/ui/web_view.dart';
import 'package:flutter_common/ui/widget/button.dart';
import 'package:flutter_common/util/context_extension.dart';

class WebViewDemo extends StatefulWidget {
  const WebViewDemo({Key? key}) : super(key: key);

  @override
  State<WebViewDemo> createState() => _WebViewDemoState();
}

class _WebViewDemoState extends State<WebViewDemo> {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      body: _content(),
    );
  }

  Widget _content(){
    return Center(
      child: FxElevatedButton(
        '打开',
        onPressed: () {
          context.push(SimpleWebView(url: "https://www.baidu.com"));
        },
      ),
    );
  }
}
